package com.manlicloud.boot.sidecar.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author shensg
 * @date 2021/8/10 15:49
 */

@RestController
@Slf4j
public class TestController {
    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/test")
    public String test() {
        log.info("进入 test 发送给sidecar 真实的异构请求");
        return restTemplate.getForObject("http://sidecar/health.json", String.class);
    }
}
